﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Common;
using DAL;
using System.Data;
using WFNetLib;

namespace 服务器端.webAPI
{
    public partial class QueryMedicalResultList_byTime : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            string id,d1,d2,type;
            MedicalResultList ret = new MedicalResultList();
            try
            {
                type = Request.QueryString["type"];
                id = Request.QueryString["ID"];
                d1 = Request.QueryString["d1"];
                d2 = Request.QueryString["d2"];
                //信息|用户id|实验id，实验名，实验室;
                if (string.IsNullOrEmpty(id))//没有这两个变量
                {
                    ret.message = "no id";
                }
                else
                {
                    MedicalResultData m = new MedicalResultData();
                    m.ID = id;
                    ret.id = id;
                    ret.list = new List<MedicalResultTitle>();
                    DataTable dt = MedicalResultDataDBOption.DataTableSelect(type,id,d1,d2);
                    for (int i = 0; i < dt.Rows.Count; i++)
                    {
                        DataRow dr = dt.Rows[i];
                        //ret.TemporaryUserID = int.Parse(dr["TemporaryUserID"].ToString());
                        MedicalResultTitle t = new MedicalResultTitle();
                        t.teid = dr["TEID"].ToString();
                        t.time = dr["Time"].ToString();
                        ret.list.Add(t);
                    }
                    ret.message = "ok";
                }
            }
            catch (System.Exception ex)
            {
                ret.message = "未知错误" + ex.Message;
            }
            Response.Write(WFJSON.JsonSerializerBySingleData<MedicalResultList>(ret));
        }
    }
}